package com.smart.service;

import com.smart.dao.LessonDao;
import com.smart.dao.TeacherDao;
import com.smart.domain.Lesson;
import com.smart.domain.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImp implements  TeacherServiceIF{


  private   TeacherDao teacherDao;

    @Autowired
    public void setTeacherDao(TeacherDao teacherDao) {
        this.teacherDao = teacherDao;
    }


    public boolean hasMatchTeacher(Teacher teacher) {
        int matchCount = teacherDao.getMatchCount(teacher);
        System.out.println("mmmmm:"+matchCount);
        return matchCount >0;
    }


    public Teacher  queryteacher(Teacher teacher)

    {
       return teacherDao.queryteacher(teacher);
    }  //通过老师用户名查询


    public  int  addteacher(Teacher teacher){   //添加新老师信息
        return  teacherDao.addteacher(teacher);
    }

   public int  deleteteacher(Teacher teacher){   //删除老师信息
        return teacherDao.deleteteacher(teacher);
   }

   public int updateteacher(Teacher teacher){    //修改老师信息
        return teacherDao.updateteacher(teacher);
   }
   public List<Teacher> queryteacherlist(){     //查询全体老师信息
         return  teacherDao.queryteacherlist();
   }






}
